home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2006 October / wn148cd2.iso / Windows / Travailler / QuickZip / quickzip_460013.exe / {app} / Scripts / BackupLatestFile.akp next >
Text File  |  2005-05-26  |  693b  |  25 lines

  1. const dir = 'c:\temp\';
  2.       mask = '*.*';
  3. var i : integer;
  4.    fs : TStrings;
  5.    most_recent_file_name : string;
  6.    most_recent_file_datetime : Tdatetime;
  7. begin
  8.   fs := pollfilelist(dir+mask,false);
  9.   most_recent_file_name := '';
  10.   most_recent_file_datetime := 0;
  11.   for i := 0 to fs.count -1 do
  12.     if GetFileDateTime(fs.strings[i]) > most_recent_file_datetime then
  13.       begin
  14.         most_recent_file_datetime := GetFileDateTime(fs.strings[i]);
  15.         most_recent_file_name := fs.strings[i];
  16.       end;
  17.       
  18.   if most_recent_file_name <> '' then
  19.   begin
  20.     Open(changefileext(most_recent_file_name,'.zip'));
  21.     Add(most_recent_file_name)
  22.     DoAdd;
  23.   end;
  24. end.
  25.